#include "thread.h"
int rm(int netfd,dirID_t* dirID){
    train_t train;
    bzero(train.buf,sizeof(train.buf));
    recv(netfd,&train.length,sizeof(train.length),MSG_NOSIGNAL);
    recv(netfd,train.buf,train.length,MSG_NOSIGNAL);
    char newBuf[256];
    char path[256];
    bzero(newBuf,sizeof(newBuf));

    bzero(path,sizeof(path));
    strcpy(path,dirID->pwdID);
    strcat(path,"/");
    char virtual_path[256];
    bzero(virtual_path,sizeof(virtual_path));
    get_user_dir(virtual_path,dirID);

    strcat(path,virtual_path);
    strcat(path,"/");

    removeHiddenCharacters(train.buf,newBuf);
    strcat(path,newBuf);
    printf("path = %s\n",path);

    int ret=unlink(path);
    ERROR_CHECK(ret,-1,"unlink");
    return 0;
}

